package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TbFaultLogMapper;
import com.ruoyi.system.domain.TbFaultLog;
import com.ruoyi.system.service.ITbFaultLogService;

/**
 * 故障记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-27
 */
@Service
public class TbFaultLogServiceImpl implements ITbFaultLogService 
{
    @Autowired
    private TbFaultLogMapper tbFaultLogMapper;

    /**
     * 查询故障记录
     * 
     * @param faultLogId 故障记录主键
     * @return 故障记录
     */
    @Override
    public TbFaultLog selectTbFaultLogByFaultLogId(Long faultLogId)
    {
        return tbFaultLogMapper.selectTbFaultLogByFaultLogId(faultLogId);
    }

    /**
     * 查询故障记录列表
     * 
     * @param tbFaultLog 故障记录
     * @return 故障记录
     */
    @Override
    public List<TbFaultLog> selectTbFaultLogList(TbFaultLog tbFaultLog)
    {
        return tbFaultLogMapper.selectTbFaultLogList(tbFaultLog);
    }

    /**
     * 新增故障记录
     * 
     * @param tbFaultLog 故障记录
     * @return 结果
     */
    @Override
    public int insertTbFaultLog(TbFaultLog tbFaultLog)
    {
        return tbFaultLogMapper.insertTbFaultLog(tbFaultLog);
    }

    /**
     * 修改故障记录
     * 
     * @param tbFaultLog 故障记录
     * @return 结果
     */
    @Override
    public int updateTbFaultLog(TbFaultLog tbFaultLog)
    {
        tbFaultLog.setUpdateTime(DateUtils.getNowDate());
        return tbFaultLogMapper.updateTbFaultLog(tbFaultLog);
    }

    /**
     * 批量删除故障记录
     * 
     * @param faultLogIds 需要删除的故障记录主键
     * @return 结果
     */
    @Override
    public int deleteTbFaultLogByFaultLogIds(Long[] faultLogIds)
    {
        return tbFaultLogMapper.deleteTbFaultLogByFaultLogIds(faultLogIds);
    }

    /**
     * 删除故障记录信息
     * 
     * @param faultLogId 故障记录主键
     * @return 结果
     */
    @Override
    public int deleteTbFaultLogByFaultLogId(Long faultLogId)
    {
        return tbFaultLogMapper.deleteTbFaultLogByFaultLogId(faultLogId);
    }
}
